package PTA;
class Book7 {
    String name;
    double price;
    int id;
    public static int num = 0;
    public  Book7() {
        num++;
        id=num;
    }
    public Book7(String name, double price) {
        this();
        this.name = name;
        this.price = price;
    }

    @Override
    public String toString() {
        return "编号：" +id+
                "，书名：" + name +
                "，价格：" + price;
    }
}

public class t7 {
    public static void main(String[] args) {
        Book7 b[]=new Book7[5];
        b[0]=new Book7("java程序设计教程",105.5);
        b[1]=new Book7("高数教程",99.5);
        b[2]=new Book7("英语教程",56.5);
        b[3]=new Book7("图形设计教程",98.8);
        b[4]=new Book7("网络教程",119.4);
        for(int i=0;i<b.length;i++)
            System.out.println(b[i].toString());
    }
}
